package com.simon.nvwo.modules.rmi;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;

public class HelloClient {
	
	public static void main(String[] args) {
		
		
		try{
			
			//在RMI服务注册列表上查找名为RHello的服务，并调用
			IHello hello=(IHello) Naming.lookup("rmi://localhost:8888/RHello");
			
			System.out.println(hello.helloWorld());
			
			System.out.println(hello.sayHelloToSmoneBody("name"));
		}catch (NotBoundException e) {
            e.printStackTrace();
        } catch (MalformedURLException e) {
            e.printStackTrace();
        } catch (RemoteException e) {
            e.printStackTrace();  
        }
	}

}
